<?php 
	$session = new Session();
	if($session->getUser() != null){
		$displayTicket = $session->getUser()->getOption("displayTicketInFeed");
		$displayStatus = $session->getUser()->getOption("displayStatusInFeed");
		$displayRelationship = $session->getUser()->getOption("displayRelationshipInFeed");
		$displayNews = $session->getUser()->getOption("displayNewsInFeed"); 
	}else{
		$displayTicket = "enable";
		$displayStatus = "enable";
		$displayRelationship = "disable";
		$displayNews = "enable";
	}
?>

<div id="div_navigation" class='p_10 m_r_10'>
	<div id='div_loginboxAction'></div>
	<?php include '/navigation/mainNavigation.php';	?>
	<?php include '/navigation/betNavigation.php';	?>
	<?php include '/navigation/storeOffers.php';	?>
</div>
<div id="div_content" class='p_10'>
	<div id='div_left'>
		<div class='div_h2'>
			<div class='div_content'><h2>Fil d'actualité</h2></div>
			<div class='div_options'>
				<span class='b'>Filtres</span> <div class='fl icon_16 optionsArrow'></div>
				<span class='tiptip action <?php echo $displayTicket; ?>' action='onoffFeed' option='ticket' title="Afficher/Cacher les tickets">Tickets</span>  
				<span class='tiptip action <?php echo $displayStatus; ?>' action='onoffFeed' option='status' title="Afficher/Cacher les statuts">Statuts</span>
				<span class='tiptip action <?php echo $displayRelationship; ?> hideable hide' action='onoffFeed' option='friendship' title="Afficher/Cacher les liens d'amitié">Amitié</span>
				<span class='tiptip action <?php echo $displayNews; ?> hideable hide' action='onoffFeed' option='news' title="Afficher/Cacher les news">News</span> 
				<span class='tiptip action' action='moreFeedOption' title="Afficher/cacher plus de filtre">+</span>
			</div>
		</div>
		
		<span id='feed_viewNew' class='viewmore action blue hide' action='feed_viewNew' minID='100'>20+ nouvelles actualitées</span>
		
		<div id='feed_feed' class='contentZone'></div>
		
		<span id='feed_viewOld' class='viewmore action' action='feed_viewOld'  maxID='100'>afficher actualités plus ancienne</span>
	</div>
	<div id='div_right'>
		<div id='friendSuggestion' class='b_ea'>

		</div>

	</div>
</div>

<script type="text/javascript">
	// chargement des parties dynamiques de la page courante
	$j.ajax({
		type : "POST",
		url : "<?php bloginfo('template_url'); ?>/ajax/getContent.php",
		data : "functionName=getFeedContent",
		success:function(html){
			$j("#feed_feed").html(html);
		}
	});	

	$j.ajax({
		type : "POST",
		url : "<?php bloginfo('template_url'); ?>/ajax/getContent.php",
		data : "functionName=getFriendSuggestionModule&nbSuggestion=4",
		success:function(html){
			$j("#friendSuggestion").html(html);
		}
	});	

	// affichage du bouton d'affichage des nouvelles actualités
	function refresh_btn_feed_viewNew(){
		var minID = $j("#feed_viewNew").attr('minID');
		$j.ajax({
			type : "POST",
			url : "<?php bloginfo('template_url'); ?>/ajax/getValue.php",
			data : "functionName=getCountNewsSinceArrived&feedType=<?php echo $getParameters[1]; ?>&minID="+ minID +"",
			success:function(response){
				if(response != ""){
					$j("#feed_viewNew").html(response + " nouvelles actualités");
					$j("#feed_viewNew").slideDown();
				}
			}
		});	
	}	
	setInterval("refresh_btn_feed_viewNew()",3000);
</script>